if(Boost_INCLUDE_DIRS)
    set(INCLUDES ${Boost_INCLUDE_DIRS})
    set(LIBS ${Boost_LIBRARIES})
else(Boost_INCLUDE_DIRS)
    set(LIBS Boost::boost)
endif(Boost_INCLUDE_DIRS)
include_directories(
    ${PROJECT_SOURCE_DIR}
    ${INCLUDES}
    )
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
    set(COMPILE_DEFINITIONS DEBUG_LEFPARSER)
else()
    set(COMPILE_DEFINITIONS "")
endif()

add_executable(test_lef_bison test_bison.cpp)
set_target_properties(test_lef_bison PROPERTIES OUTPUT_NAME "test_bison")
target_link_libraries(test_lef_bison PRIVATE lefparser ${LIBS})
if(COMPILE_DEFINITIONS)
    target_compile_definitions(test_lef_bison PRIVATE ${COMPILE_DEFINITIONS})
endif(COMPILE_DEFINITIONS)
if(INSTALL_LIMBO)
    install(TARGETS test_lef_bison DESTINATION test/parsers/lef)
endif(INSTALL_LIMBO)

add_executable(test_lef_adapt test_adapt.cpp)
set_target_properties(test_lef_adapt PROPERTIES OUTPUT_NAME "test_adapt")
target_link_libraries(test_lef_adapt PRIVATE ${PROJECT_BINARY_DIR}/limbo/parsers/lef/adapt/liblefparseradapt.a ${LIBS})
add_dependencies(test_lef_adapt lefparseradapt)
if(COMPILE_DEFINITIONS)
    target_compile_definitions(test_lef_adapt PRIVATE ${COMPILE_DEFINITIONS})
endif(COMPILE_DEFINITIONS)
if(INSTALL_LIMBO)
    install(TARGETS test_lef_adapt DESTINATION test/parsers/lef)
endif(INSTALL_LIMBO)

#add_executable(test_lef_spirit test_spirit.cpp)
#set_target_properties(test_lef_spirit PROPERTIES OUTPUT_NAME "test_spirit")
#if(COMPILE_DEFINITIONS)
#    target_compile_definitions(test_lef_spirit PRIVATE ${COMPILE_DEFINITIONS})
#endif(COMPILE_DEFINITIONS)
if(INSTALL_LIMBO)
	#install(TARGETS test_lef_spirit DESTINATION test/parsers/lef)
    install(DIRECTORY benchmarks DESTINATION test/parsers/lef)
endif(INSTALL_LIMBO)
